package com.diandian.backend.dingding.data.controller;

import com.diandian.backend.dingding.data.service.DingdingDeptTreeStaffOpenApiService;
import com.diandian.base.boot.starter.response.BaseResult;
import com.diandian.base.boot.starter.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * [钉钉]部门树员工关联表
 */
@RestController
@RequestMapping("/dept/tree/staff/open/api")
public class DingdingDeptTreeStaffOpenApiController {

    @Autowired
    private DingdingDeptTreeStaffOpenApiService iDingdingDeptTreeStaffService;

    /**
     * 根据工号查询关联的组织
     */
    @GetMapping("/getDeptByJobNumber")
    public BaseResult getDeptByJobNumber(@RequestParam(value = "jobNumber") String jobNumber,
                                         @RequestParam(value = "belong") String belong,
                                         @RequestParam(value = "deepFlag", required = false) Boolean deepFlag) {
        return ResultUtil.makeResult(iDingdingDeptTreeStaffService.getDeptByJobNumber(belong, jobNumber, deepFlag));
    }

}